﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Work_5._5
{
    internal class IsTriangle
    {
        public string DetermineTriangle(double A_x, double A_y, double B_x, double B_y, double C_x, double C_y)
        {
            double Y_ab = (C_x - A_x) * (B_y - A_y) / (B_x - A_x) + A_y;
            double Y_ac = (B_x - A_x) * (C_y - A_y) / (C_x - A_x) + A_y;
            double Y_bc = (A_x - B_x) * (C_y - B_y) / (C_x - B_x) + B_y;
            if (A_x == B_x & A_x == C_x & B_x == C_x && A_y == B_y & B_y == C_y & A_y == C_y)
            {
                return "三点重合了";
            } else if (A_x == B_x & A_x == C_x & B_x == C_x )
            {
                return "是一条竖线";
            }else if ( A_y == B_y & B_y == C_y & A_y == C_y)
            {
                return "是一条横线";
            }
            else if(A_x == C_x && A_y == C_y)
            {
                return "AC两点重合了";
            }
            else if (B_x == C_x && B_y == C_y)
            {
                return "BC两点重合了";
            }else if (A_x == B_x && A_y == B_y)
            {
                return "AB两点重合了";
            }else if (C_y == Y_ab | B_y == Y_ac | A_y == Y_bc)
            {
                return "三点是一条斜线";
            }
            return "是三角形";
        }
    }
}
